# define _CRT_SECURE_NO_WARNINGS 1
#include "Search.h"


int main()
{
	//int array[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
	//int size = sizeof(array) / sizeof(array[0]);
	//Sequential_Search(array, size, 100);
	TreeNode* A = (TreeNode*)malloc(sizeof(TreeNode));
	A->data = 62;

	TreeNode* B = (TreeNode*)malloc(sizeof(TreeNode));
	B->data = 58;

	TreeNode* C = (TreeNode*)malloc(sizeof(TreeNode));
	C->data = 88;

	TreeNode* D = (TreeNode*)malloc(sizeof(TreeNode));
	D->data = 47;

	TreeNode* E = (TreeNode*)malloc(sizeof(TreeNode));
	E->data = 73;

	TreeNode* F = (TreeNode*)malloc(sizeof(TreeNode));
	F->data = 99;

	TreeNode* G = (TreeNode*)malloc(sizeof(TreeNode));
	G->data = 93;


	A->left = B;
	A->right = C;
	B->left = D;
	B->right = NULL;
	D->left = NULL;
	D->right = NULL;
	C->left = E;
	C->right = F;
	E->left = NULL;
	E->right = NULL;
	F->left = G;
	F->right = NULL;
	G->left = NULL;
	G->right = NULL;

	TreeNode* ret = NULL;

	




	if (SearchBST(A, 73, NULL, &ret))
	{
		printf("%d", ret->data);
	}
	if (ret = NewSearchBST(A, 73))
	{
		printf("%d", ret->data);
	}





	return 0;
}